import { createAlova } from 'alova'
//请求适配器，可以换axios https://alova.js.org/zh-CN/resource/request-adapter/axios
import adapterFetch from 'alova/fetch'
import VueHook from 'alova/vue'

export const request = createAlova({
  baseURL: import.meta.env.VITE_BASE_URL,
  timeout: 5000,
  requestAdapter: adapterFetch(),
  statesHook: VueHook,
  beforeRequest(method) {
    console.log(method,'method');
    
    // 假设我们需要添加token到请求头
    method.config.headers.token = 'token'
  }
})

  
